package com.isoft.demo.controller;

import com.isoft.demo.common.ResponseData;
import com.isoft.demo.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @ClassName:PermissionController
 * @Description: TODO
 * @Author guowei
 * @Date:2021/7/6 14:15
 */
@RestController
@CrossOrigin
public class PermissionController {
    @Autowired
    private PermissionService service;

    @GetMapping("/c")
    public ResponseData getCodeByid(int customerid){
        ResponseData rd = new ResponseData();
        rd.setData(service.searchByLoginid(customerid));
        return rd;
    }

    @GetMapping("/sc")
    public ResponseData getCodeByPid(int parentid) {
        ResponseData rd = new ResponseData();
        rd.setData(service.searchByparentid(parentid));
        return rd;
    }
}
